import request from '@/utils/request'
//获取巡检点配置列表
export const ListInspectionPointConfiguration = (params, page, size) => {
  return request({
    url: `/opermgt/patrolPoint/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
/**
 * 巡检计划表保存
 * @param {*} data
 * @returns
 */
export const InspectionPointConfigurationSave = (data) => {
  return request({
    url: '/opermgt/patrolPoint',
    method: 'POST',
    data: data
  })
}
//巡检计划表删除
export const InspectionPointConfigurationDel = (id) => {
  return request({
    url: `/opermgt/patrolPoint/${id}`,
    method: 'DELETE'
  })
}
//获取巡检点记录列表
export const ListInspectionRecord = (params, page, size) => {
  return request({
    url: `/opermgt/patrolRecords/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
/**
 * 巡检点记录登记保存
 * @param {*} data
 * @returns
 */
export const InspectionRecordSave = (data) => {
  return request({
    url: '/opermgt/patrolRecords',
    method: 'POST',
    data: data
  })
}
// /巡检点类型下拉列表
export const PmiPointTypeDrop = () => {
  return request({
    url: '/opermgt/patrolPlan/findAllPatrolPointType'
  })
}
// /巡检类型下拉列表
export const CheckingTypeDrop = () => {
  return request({
    url: '/opermgt/patrolPlan/findAllPatrolType'
  })
}

//获取巡检点分组列表
export const GroupingInspectionRecord = (data) => {
  return request({
    url: '/opermgt/patrolRecords/searchLocationTree',
    data: data
  })
}
//根据巡检树查询
export const ByGroupingSearch = (data) => {
  return request({
    url: '/opermgt/patrolRecords/searchListByLocationTree',
    method: 'POST',
    data: data
  })
}
//根据巡检点id集合分页查询巡检记录
export const ByGroupingIdSearch = (data, page, size) => {
  return request({
    url: `/opermgt/patrolRecords/findRecordsByPatrolPointIds/${page}/${size}`,
    method: 'POST',
    data: data
  })
}
